/*    */ package com.zimbra.cs.dav.resource;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.dav.DavContext;
/*    */ import com.zimbra.cs.dav.DavElements;
/*    */ import com.zimbra.cs.dav.DavException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class Principal
/*    */   extends DavResource
/*    */ {
/*    */   protected Account mAccount;
/*    */   
/*    */   public Principal(Account authUser, String mainUrl)
/*    */     throws ServiceException
/*    */   {
/* 30 */     this(getOwner(authUser, mainUrl), mainUrl);
/*    */   }
/*    */   
/*    */   public Principal(String user, String mainUrl) throws ServiceException {
/* 34 */     super(mainUrl, user);
/* 35 */     if (!mainUrl.endsWith("/")) mainUrl = mainUrl + "/";
/* 36 */     setProperty(DavElements.E_HREF, mainUrl);
/* 37 */     setProperty(DavElements.E_GROUP_MEMBER_SET, null, true);
/* 38 */     setProperty(DavElements.E_GROUP_MEMBERSHIP, null, true);
/* 39 */     addResourceType(DavElements.E_PRINCIPAL);
/* 40 */     this.mUri = mainUrl;
/*    */   }
/*    */   
/*    */   public static String getOwner(Account acct, String url)
/*    */     throws ServiceException
/*    */   {
/* 46 */     return acct.getName();
/*    */   }
/*    */   
/*    */   public void delete(DavContext ctxt) throws DavException
/*    */   {
/* 51 */     throw new DavException("cannot delete this resource", 403, null);
/*    */   }
/*    */   
/*    */   public boolean isCollection()
/*    */   {
/* 56 */     return false;
/*    */   }
/*    */   
/*    */   public Account getAccount() {
/* 60 */     return this.mAccount;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/dav/resource/Principal.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */